﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CheckIn.ToolsHost.Infrastructures
{
    public class FiveElementService
    {
        string[] _numberArr;
        Dictionary<string, string> _chineseZodiacElements;
        public FiveElementService()
        {
            _numberArr = "水,木,木,火,火,土,土,金,金,水".Split(',');

            _chineseZodiacElements = new Dictionary<string, string>
{
    { "子", "水" },
    { "丑", "土" },
    { "寅", "木" },
    { "卯", "木" },
    { "辰", "土" },
    { "巳", "火" },
    { "午", "火" },
    { "未", "土" },
    { "申", "金" },
    { "酉", "金" },
    { "戌", "土" },
    { "亥", "水" }
};
        }

        public string GetFiveElement(int number)
        {
            var gw = number % 10;
            return _numberArr[gw];
        }

        public string GetFiveElementByChinese(string chinese)
        {
            if (_chineseZodiacElements.TryGetValue(chinese, out string v))
                return v;

            return null;
        }

       
    }
}
